<?php

class spLink extends spElement
{
	const MODE_EXTERNAL_CSS = "mode_external_css";

	public function __construct( $param="", $mode=spLink::MODE_EXTERNAL_CSS )
	{
		parent::__construct( "link", $param );

		switch ( $mode )
		{
			case spLink::MODE_EXTERNAL_CSS:
				parent::addAttr( "rel" , "stylesheet" );
				parent::addAttr( "type", "text/css" );
				break;
		}
		
		if ( isset( $param["href"] ) )
			parent::addAttr( "href", $param["href"] );
	}

	// convenience method
	public function setHref( $href )
	{
		parent::addAttr( "href", $href );
	}
}

?>